<div ng-include="sys_html('layout/order/_header')"></div>
<style>
.modal-open {
	overflow:hidden
}
.modal {
	position:fixed;
	top:0;
	right:0;
	bottom:0;
	left:0;
	z-index:1050;
	display:none;
	overflow:hidden;
	-webkit-overflow-scrolling:touch;
	outline:0
}
.modal.fade .modal-dialog {
	-webkit-transition:-webkit-transform .3s ease-out;
	-o-transition:-o-transform .3s ease-out;
	transition:transform .3s ease-out;
	-webkit-transform:translate(0,-25%);
	-ms-transform:translate(0,-25%);
	-o-transform:translate(0,-25%);
	transform:translate(0,-25%)
}
.modal.in .modal-dialog {
	-webkit-transform:translate(0,0);
	-ms-transform:translate(0,0);
	-o-transform:translate(0,0);
	transform:translate(0,0)
}
.modal-open .modal {
	overflow-x:hidden;
	overflow-y:auto
}
.modal-dialog {
	position:relative;
	width:auto;
	margin:10px
}
.modal-content {
	position:relative;
	background-color:#fff;
	-webkit-background-clip:padding-box;
	background-clip:padding-box;
	border:1px solid #999;
	border:1px solid rgba(0,0,0,.2);
	border-radius:6px;
	outline:0;
	-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);
	box-shadow:0 3px 9px rgba(0,0,0,.5)
}
.modal-backdrop {
	position:fixed;
	top:0;
	right:0;
	bottom:0;
	left:0;
	z-index:1040;
	background-color:#000
}
.modal-backdrop.fade {
	filter:alpha(opacity=0);
	opacity:0
}
.modal-backdrop.in {
	filter:alpha(opacity=50);
	opacity:.5
}
.modal-header {
	padding:15px;
	border-bottom:1px solid #e5e5e5
}
.modal-header .close {
	margin-top:-2px
}
.modal-title {
	margin:0;
	line-height:1.42857143
}
.modal-body {
	position:relative;
	padding:15px
}
.modal-footer {
	padding:15px;
	text-align:right;
	border-top:1px solid #e5e5e5
}
.modal-footer .btn+.btn {
	margin-bottom:0;
	margin-left:5px
}
.modal-footer .btn-group .btn+.btn {
	margin-left:-1px
}
.modal-footer .btn-block+.btn-block {
	margin-left:0
}
.modal-scrollbar-measure {
	position:absolute;
	top:-9999px;
	width:50px;
	height:50px;
	overflow:scroll
}
@media (min-width:768px) {
	.modal-dialog {
	width:600px;
	margin:30px auto
}
.modal-content {
	-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);
	box-shadow:0 5px 15px rgba(0,0,0,.5)
}
.modal-sm {
	width:300px
}
}@media (min-width:992px) {
	.modal-lg {
	width:900px
}
}
</style>
<div class="ncc-wrapper" id="loadhtml" style="display:none">
    <div class="ncc-main">
        <div class="ncc-title">
            <h3>填写核对购物信息</h3>
            <h5>请仔细核对填写收货、发票等信息，以确保物流快递及时准确投递。</h5>
        </div>
        <div class="ncc-receipt-info">
            <div class='fui-content  '>
                <!--快递或者上门自提 ng-if="count(pagedata.carrier_list>0)&&pagedata.isverify && !pagedata.isvirtual" -->
                    <div id="carrierTab" class="fui-tab fui-tab-danger">
                        <a data-tab="tab1" ng-class="{'fui-tag fuilabel fuilabel-red-0 sale-tip':1,'active':pagedata.post.sendtype==1}" ng-click="pagedata.post.sendtype=1">快递配送</a>
                        <a data-tab="tab2" ng-class="{'fui-tag fuilabel fuilabel-red-0 sale-tip':1,'active':pagedata.post.sendtype==2}" ng-click="pagedata.post.sendtype=2">上门自提</a>
                    </div>
                <!--地址选择 ng-if="!pagedata.isverify && !pagedata.isvirtual"-->
                <div ng-if="pagedata.post.sendtype !=2" class="fui-list-group" id='addressInfo'>
                    <a ng-if="!pagedata.item.address" class="fui-list external" href="javascript:;" ng-click="modal_func(pagedata.item,'address','/member.address/')" data-nocache="true">                     <div class="fui-list-media">
                            <i class="icon icon-map"></i>
                        </div>
                        <div class="fui-list-inner">
                            <div class="text no-address">
                                <i class="icon icon-add"></i> 添加收货地址
                            </div>
                        </div>
					</a>
					<a ng-if="pagedata.item.address" class="fui-list" href="javascript:;" ng-click="access_json('/member.address/')">
                        <div class="fui-list-media">
                            <i class="icon icon-map"></i>
                        </div>
                        <div class="fui-list-inner">							<div ng-if="pagedata.item.address" class="title has-address">
                                <span class='realname'>{{pagedata.item.address.name || '匿名'}}</span> <span class='mobile'>{{pagedata.item.address.mobile}}</span>
                            </div>
                            <div ng-if="pagedata.item.address" class="text has-address">
                                <span class='address'>{{pagedata.item.address.pcd.province}} {{pagedata.item.address.pcd.city}} {{pagedata.item.address.pcd.district}} {{pagedata.item.address.address}}</span>
                            </div>
                        </div>
					</a>
                </div>
                <!--自提点选择-->
                <div ng-if="pagedata.post.sendtype ==2" class="fui-list-group" id="carrierInfo">
                    <a class="fui-list" href="javascript:;" onclick="$('#showstores').modal();">
                        <div class="fui-list-media">
                            <i class="icon icon-dianpu"></i>
                        </div>
                        <div class="fui-list-inner">
                            <div class="title"><span class='storename'>{{pagedata.selectstore.title}}</span></div>
                            <div class="subtitle"><span class='realname'>{{pagedata.selectstore.realname}}</span> <span class='mobile' id="carrierInfo_mobile">{{pagedata.selectstore.mobile}}</span>
                            </div>
                            <div class="text"><span class='address'>{{pagedata.selectstore.pcd.province}} {{pagedata.selectstore.pcd.city}} {{pagedata.selectstore.pcd.district}} {{pagedata.selectstore.address}}</span></div>
                        </div>
                        <div class="fui-list-angle">
                            <div class="angle"></div>
                        </div>
                    </a>
                </div>
                <!--联系填写-->
                <div ng-if="pagedata.isverify && pagedata.isvirtual" class="fui-cell-group sm"
                     id="memberInfo">
                    <div class="fui-cell">
                        <div class="fui-cell-label sm">联系人</div>
                        <div class="fui-cell-info"><input type="text" placeholder="请输入联系人" name='carrier_realname'
                                                          class="fui-input"
                                                          value="{{pagedata.member.realname}}"/></div>
                    </div>
                    <div class="fui-cell">
                        <div class="fui-cell-label sm">联系电话</div>
                        <div class="fui-cell-info"><input type="tel" placeholder="请输入联系电话" name='carrier_mobile'
                                                          class="fui-input"
                                                          value="{{pagedata.member.mobile}}"/></div>
                    </div>
                </div>
            </div>
         
        </div>
        <div class="ncc-receipt-info">
            <div class="fui-list-group">
                <div class="fui-list-group-title"><i class="icon icon-shop"></i>{{pagedata.pc_set.pc_title}}</div>					<div ng-repeat="g in pagedata.order.list">
                    <div class="fui-list goods-item">
                        <div class="fui-list-media">
                            <a href="javascript:;" ng-click="access_json('jy_weishop/goods.detail//id='+g.goodsid)">
                                <img ng-src="{{tomedia(g.image)}}" class="round" style="height:2.5rem">
                            </a>
                        </div>
                        <div class="fui-list-inner">
                            <a href="javascript:;" ng-click="access_json('jy_weishop/goods.detail//id='+g.goodsid)">
                                <div class="text">
                                        <span ng-if="empty(g.isnodiscount) && !empty(g.dflag)" class='fui-label fui-label-danger'>折扣</span>
                                    {{g.title}}
                                </div>
                                    <div class="text">
                                        {{g.optiontitle || '无规格'}} <span class="num bold">{{pagedata.order.weight || '0.210'}}kg x {{g.total}}</span>
                                    </div>
                            </a>
                        </div>
                        <div class='fui-list-angle'>
                            <span class="price ">￥<span class='marketprice'>{{g.price}}</span></span>
							<span class="total">x {{g.total}}</span>
                        </div>                       </div>
                    </div>
                <div class='fui-cell-group'>
                        <div ng-if="pagedata.hasinvoice" class="fui-cell">
                            <div class="fui-cell-label">发票抬头</div>
                            <div class="fui-cell-info">
							<input type='text' class='fui-input' value="{{pagedata.invoicename}}" id='invoicename'/></div>
                        </div>
                    <div class="fui-cell">
                        <div class="fui-cell-info" style="text-align: right;">共 <span id='goodscount' class='text-danger'>{{pagedata.order.total}}</span> 件商品 合计：<span class="text-danger">￥<span class='goodsprice'>{{pagedata.order.total_price}}</soan></span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="ncc-receipt-info">
            <div class="fui-cell-group  sm">
                <div ng-if="pagedata.couponcount>0" id='coupondiv' class="fui-cell fui-cell-click">
                    <div class='fui-cell-label' style='width:auto;'>优惠券</div>
                    <div class='fui-cell-info'></div>
                    <div class='fui-cell-remark'>
                        <div class='badge badge-danger'>{{pagedata.couponcount}}
                        </div>
                        <span class='text' ng-if="pagedata.couponcount<=0">无可用</span>
                    </div>
                </div>
            </div>
        </div>
            <div ng-if="pagedata.deductcredit>0" class="ncc-receipt-info">
                <div class="fui-cell">
                    <div class="fui-cell-label" style="width: auto;"><span id="deductcredit_info" class='text-danger'>{{pagedata.deductcredit}}</span>积分可抵扣 <span id="deductcredit_money" class='text-danger'>{{deductmoney}}</span>元</div>
                    <div class="fui-cell-info"></div>
                    <div class="fui-cell-remark noremark">
					<input id="deductcredit" type="checkbox" class="fui-switch fui-switch-small fui-switch-success pull-right">
                    </div>
                </div>
            </div>
            <div ng-if="pagedata.deductcredit2>0" class="ncc-receipt-info">
                <div class="fui-cell">
                    <div class="fui-cell-label" style="width: auto;">积分可抵扣 <span id='deductcredit2_money' class="text-danger">{{pagedata.deductcredit2}}</span>元
                    </div>
                    <div class="fui-cell-info"></div>
                    <div class="fui-cellfui-cell-remark noremarkinfo">
					<input id="deductcredit2" type="checkbox" class="fui-switch fui-switch-small fui-switch-success pull-right">
                    </div>
                </div>
            </div>
            <div ng-if="pagedata.stores.length>0" class='ncc-receipt-info fui-according-group'>
                <div class='fui-according'>
                    <div class='fui-according-header'>
                        <i class='icon icon-dianpu'></i>
                        <span class="text">适用门店</span>
                        <span class="remark"><div class="badge">{{count(pagedata.stores)}}</div></span>
                    </div>
                    <div class="fui-according-content store-container">
                            <div ng-repeat="item in pagedata.stores" class="fui-list store-item" data-lng="{{item.lng}}"
                                 data-lat="{{item.lat}}">
                                <div class="fui-list-media">
                                    <i class='icon icon-dianpu'></i>
                                </div>
                                <div class="fui-list-inner store-inner">
                                    <div class="title"><span class='storename'>{{item.storename}}</span></div>
                                    <div class="text">
                                        地址: <span class='realname'>{{item.address}}</span>
                                    </div>
                                    <div class="text">
                                        电话: <span class='address'>{{item.tel}}</span>
                                    </div>
                                </div>
                                <div class="fui-list-angle ">
                                    <a ng-if="item.tel" href="tel:{{item.tel}}" class='external '><i class="icon icon-phone" style='color:green'></i></a>
                                    <a href="javascript:;" ng-click="access_json('jy_weishop/store.map//id='+item.id+'&merchid='+item.merchid)"
                                       class='external'><i class='icon icon-location' style='color:#f90'></i></a>
                                </div>
                            </div>
                    </div>
                    <div id="nearStore" style="display:none">
                        <div class='fui-list store-item' id='nearStoreHtml'></div>
                    </div>
                </div>
            </div>
            <div ng-if="!pagedata.order_formInfo" class="ncc-receipt-info fui-cell-group sm ">
                <div class="fui-cell">
                    <div class="fui-cell-info">
					<input type="text" class="fui-input" id='remark' placeholder="选填: 买家留言(50字以内)" maxlength="50"></div>
                </div>
            </div>
        <div class="fui-cell-group sm">
            <input type="hidden" id="weight" name='weight' value="{{pagedata.total_weight}}"/>
            <div class="fui-cell">
                <div class="fui-cell-label">商品小计</div>
                <div class="fui-cell-info"></div>
                <div class="fui-cell-remark noremark">￥<span class='goodsprice'>{{pagedata.order.total_price}}</span>
                 </div>
            </div>
            <div class="fui-cell">
                <div class="fui-cell-label">运费</div>
                <div class="fui-cell-info"></div>
                <div class="fui-cell-remark noremark">￥<span class='dispatchprice'>{{pagedata.order.dispatchprice || '0.00'}}</span></div>
            </div>
                <div ng-if="pagedata.order.level_de_price>0" class="fui-cell">
                    <div class="fui-cell-label" style='width:auto'>会员优惠</div>
                    <div class="fui-cell-info"></div>
                    <div class="fui-cell-remark noremark">-￥<span id='discountprice' class='discountprice'>{{pagedata.order.level_de_price}}</span>
                    </div>
                </div>
                <div ng-if="pagedata.isdiscountprice>0" class="fui-cell">
                    <div class="fui-cell-label" style='width:auto'>促销优惠</div>
                    <div class="fui-cell-info"></div>
                    <div class="fui-cell-remark noremark">-￥<span id='isdiscountprice' class='isdiscountprice'>{{pagedata.isdiscountprice}}</span>
                    </div>
                </div>
            <div ng-if="pagedata.saleset.showenough" class="fui-cell" id="deductenough">
                <div class="fui-cell-label" style='width:auto'>商城单笔满 <span id="deductenough_enough" class='text-danger'>{{pagedata.saleset.enoughmoney}}</span>
                    元立减
                </div>
                <div class="fui-cell-info"></div>
                <div class="fui-cell-remark noremark">-￥<span id='deductenough_money'>{{ifelse(pagedata.saleset.showenough,pagedata.saleset.enoughdeduct,'')}}</span>
                </div>
            </div>
            <div ng-if="pagedata.merch_saleset.merch_showenough" class="fui-cell" id="merch_deductenough">
                <div class="fui-cell-label" style='width:auto'>商户单笔满 <span id="merch_deductenough_enough" class='text-danger'>{{pagedata.merch_saleset.merch_enoughmoney}}</span> 元立减</div>
                <div class="fui-cell-info"></div>
                <div class="fui-cell-remark noremark">-￥<span id='merch_deductenough_money'>{{ifelse(pagedata.merch_saleset.merch_showenough,pagedata.merch_saleset.merch_enoughdeduct,'')}}</span>
                </div>
            </div>
            <div class="fui-cell" id='coupondeduct_div' style='display:none'>
                <div class="fui-cell-label" style='width:auto' id='coupondeduct_text'></div>
                <div class="fui-cell-info"></div>
                <div class="fui-cell-remark noremark">-￥<span id="coupondeduct_money">0</span></div>
            </div>
            <div class="fui-navbar order-create-checkout" style="position:relative;border:1px solid #D9D9D9;margin-top:0.8rem;">
                <a href="javascript:;" class="nav-item total">
                    <p>需付：<span class="text-danger ">￥<span  class="totalprice">{{pagedata.order.endprice}}</span></span>
                    </p>
                </a>
                <a ng-if="!pagedata.order_id" href="javascript:;" class="nav-item btn btn-danger buybtn" ng-click="pagedata.pay_submit(pagedata.post,'post')">立即支付</a>
				 <a ng-if="pagedata.order_id" href="javascript:;" class="nav-item btn btn-danger buybtn" ng-click="access_json('/order.detail//id='+pagedata.order_id+'&fromcreate=1')">查看订单</a>
            </div>
            <div class="ncc-receipt-info">				<div ng-include="sys_html('sale/coupon/util/picker')"></div>
            </div>
        </div>
    </div>
<div id="showstores"  class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
	<div class="modal-dialog" style="width:800px;top:20%;max-height:480px">
		<div class="modal-content">
			<div class="modal-body" style="padding:10px;">
			<div class="fui-list-group"  id="carrierInfo" style="margin: 0 0 0.5rem">
					<a class="fui-list"  ng-repeat="item in pagedata.carrier_list" href="javascript:;" ng-click="pagedata.selectstores(item.id);pagedata.selectstore = item;">
						<div class="fui-list-media">
							<i class="icon icon-map"></i>
						</div>
						<div class="fui-list-inner">
							<div class="subtitle" >
								<span style="overflow: hidden;display: inline-block;">线下门店</span>
								<span class='realname'>{{item.title}}</span>
								
							</div>
							<div class="text address">地址：<span style="color:red">{{item.pcd.province}}</span>({{item.pcd.district}} {{item.pcd.street}} {{item.address}})</div>
						</div>
						<div class="fui-list-angle">
							<div class="angle"></div>
						</div>
					</a>
			</div>
			</div>
			</div>
		</div>
	</div>
</div><div ng-include="sys_html('layout/order/_footer')"></div>
<script language='javascript'>
scope.pagedata.pay_submit=function(post,post_url){
	scope.post_json(post_url,post,function(result){
		scope.pagedata.order_id=result.order_id;
		scope.$evalAsync();
		require(['jinyun_socket'],function(jinyun_socket){
					jinyun_socket.connect();
					jinyun_socket.onsystem=function(res){
						$('#core-pay-modal').modal('hide');
						scope.message('支付成功！','success','jy_weishop/order.list//fromcreate=1');
					}
		});
		scope.tool.pay(result.pay_id,function(res){
		},'',scope.pagedata.forward_url);
	});
}
scope.pagedata.selectstores=function(id){
	console.log('选择门店'+id);
	scope.pagedata.post.storeid = id;
	$('#showstores').modal('hide');
}
</script>